package gamesys;

import javax.swing.JFrame;

@SuppressWarnings("serial")
public class Program extends JFrame {

	GamePanel panel;
	public Program()
	{
		super("BomberBoys");
		setSize(512, 512); //set default size
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true); //must be visible before seting up GamePanels
		
		setPanel(new NetworkOptionsPanel());

	}
	
	public void render()
	{
		if(panel != null)
		  panel.render();
	}
	
	public void setPanel(GamePanel comp)
	{
		if(this.panel != null)
			this.remove(panel);
		comp.setVisible(false);
		comp.setParentFrame(this);
		this.add(comp);
		comp.intitialize(2);
		panel = comp;
		panel.setVisible(true);
		this.repaint();
		
	}
	
	public static void main(String[] args) {
		Program program = new Program();

		while(program.isVisible())
			program.render();
	}
	

}
